'use strict';

const Controller = require('egg').Controller;

class lwjmethod extends Controller {
  async index() {
    const data = await this.ctx.service.lwjmethod.findAll(this.ctx);
    this.ctx.body = data;
  }
  async lwjmethod() {
    const data = await this.ctx.service.lwjmethod.lwjmethod(this.ctx);
    this.ctx.body = data;
  }
  async lwjhome() {
    const data = await this.ctx.service.lwjmethod.lwjhome(this.ctx);
    this.ctx.body = data;
  }
  async lwjsearch() {
    const data = await this.ctx.service.lwjmethod.lwjsearch(this.ctx);
    this.ctx.body = data;
  }
  async show() {
    const ctx = this.ctx;
    const userId = ctx.params.id;
    const user = await this.ctx.service.lwjmethod.find(userId);
    ctx.body = user;
  }
  async create() {
    const ctx = this.ctx;
    const params = ctx.request.body;
    const data = await ctx.service.lwjmethod.create(params);
    ctx.body = data;
  }
  async lwjpost() {
    const ctx = this.ctx;
    const params = ctx.request.body;
    const data = await ctx.service.lwjmethod.lwjpost(params);
    ctx.body = data;
  }
  async destroy() {
    const ctx = this.ctx;
    const userId = ctx.params.id;
    const del = await ctx.service.lwjmethod.delete(userId);
    ctx.body = del;
  }
  // async lwjdelete() {
  //   const ctx = this.ctx;
  //   const userId = ctx.params.id;
  //   const del = await ctx.service.lwjmethod.lwjdelete(userId);
  //   ctx.body = del;
  // }
  async update() {
    const ctx = this.ctx;
    const userId = ctx.params.id;
    const params = ctx.request.body;
    const change = await ctx.service.lwjmethod.update(userId, params);
    ctx.body = change;
  }
  async lwjupdate() {
    const ctx = this.ctx;
    const userId = ctx.params.id;
    const params = ctx.request.body;
    const change = await ctx.service.lwjmethod.lwjupdate(userId, params);
    ctx.body = change;
  }
}
module.exports = lwjmethod;
